﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Library;

namespace OA.Exam
{
    public partial class ExamPapersManage : System.Web.UI.Page
    {
        Exam myExam = new Exam();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //绑定可批阅试卷列表
                BindExamPapers("","");
            }
        }

        void BindExamPapers(string paperName,string userName)
        {
            GridViewExamPapers.DataSource = myExam.GetExamPaperForMark(paperName, userName);
            GridViewExamPapers.DataBind();
        }
        //查询
        protected void BtnSearcn_Click(object sender, EventArgs e)
        {
            BindExamPapers(TxtPaperName.Text.Trim(), TxtUserName.Text.Trim());
        }

        protected void GridViewExamPapers_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                HiddenField HiddenFieldStatus = (HiddenField)e.Row.FindControl("HiddenFieldStatus");
                HyperLink HylPaperName = (HyperLink)e.Row.FindControl("HylPaperName");
                if (HiddenFieldStatus.Value == "1")
                {
                    HylPaperName.NavigateUrl = "";
                }
            }
        }


    }
}
